import BaseMapHandler from './BaseMapHandler';

export default class MapSwitchHandler extends BaseMapHandler {
  name = '切换到地图模式'
  type = 'map-switch'
  description = '切换到地图模式'
  active = false
  callback: () => void 

  constructor(callback:() => void) {
    super()
    this.callback = callback
  }

  activate(): void {
    this.active = true
    console.log('地图模式已激活')
  }

  deactivate(): void {
    this.active = false
    console.log('地图模式已停用')
  }

  handle(): void {
    // 触发模式切换
    (window as any).mapController.switchToMapMode()
  }
}